﻿using System.Web.Mvc;
using SilenthinkCommon.Extension;

namespace Web.Areas.Help
{
    public class HelpAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Help";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.Routes.MapSubDomainRoute(
                "HelpQuestion", AreaName.ToLower(), // SubDomain
                "question-{param}.html", // Url
                new { controller = "Home", action = "Question", param = UrlParameter.Optional }, // Defaults
                new[] { "Web.Areas.Help.Controllers" }); // Namespace

            context.Routes.MapSubDomainRoute(
                "HelpDefault", AreaName.ToLower(), // SubDomain
                "{controller}/{action}/param", // Url
                new { controller = "Home", action = "Index", param = UrlParameter.Optional }, // Defaults
                new[] { "Web.Areas.Help.Controllers" }); // Namespace
        }
    }
}
